]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
iconGrid: Handle preferred height requests for infinite widths
authorRui Matos <tiagomatos@gmail.com>
Sun, 1 Jul 2012 16:38:28 +0000 (18:38 +0200)
committerCosimo Cecchi <cosimoc@gnome.org>
Mon, 3 Dec 2012 17:43:46 +0000 (12:43 -0500)
Request enough height to fit all children in a single line instead of
requesting 0.

https://bugzilla.gnome.org/show_bug.cgi?id=679168

js/ui/iconGrid.js

index 81f5cef84b428eb26d42fbcf1fe86e645c19d62d..04b8caf69b7bb7530b91b8aa2b3e6daa326c4725 100644 (file)
@@ -198,7 +198,11 @@ const IconGrid = new Lang.Class({
 
     _getPreferredHeight: function (grid, forWidth, alloc) {
         let children = this._getVisibleChildren();
-        let [nColumns, usedWidth] = this._computeLayout(forWidth);
+        let nColumns;
+        if (forWidth < 0)
+            nColumns = children.length;
+        else
+            nColumns = this._computeLayout(forWidth)[0];
         let nRows;
         if (nColumns > 0)
             nRows = Math.ceil(children.length / nColumns);